package com.example.gmallproviderdubbospringboot.serviceImpl;

import com.alibaba.dubbo.config.annotation.Service;
import com.example.gmallinterfacedubbospringboot.rr.pojo.UserAddress;
import com.example.gmallinterfacedubbospringboot.rr.service.UserService;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * @author : RENBIAO
 * @createTime : 2021/7/8 19:10
 */
@Service
@Component
public class UserServiceImpl implements UserService {

    /**
     * 根据用户ID，查找用户收货地址信息
     **/
    @Override
    public List<UserAddress> getUserAddressList(String userId) {

        UserAddress userAddress1 = UserAddress.builder()
                .id(1)
                .userAddress("天津市西青区海泰发展5道海泰创新基地青年公寓999")
                .userId("10001")
                .consignee("小红")
                .phoneNum("12345678901")
                .isDefault("Y")
                .build();

        UserAddress userAddress2 = UserAddress.builder()
                .id(2)
                .userAddress("天津市武清区新源道18号健康产业园快捷酒店888")
                .userId("10001")
                .consignee("小红")
                .phoneNum("12345678901")
                .isDefault("Y")
                .build();

        return Arrays.asList(userAddress1, userAddress2);
        
    }
}
